<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
   ______                  __  __
  / ____/___  __  ______  / /_/ /_  __
 / /   / __ \/ / / / __ \/ __/ / / / /
/ /___/ /_/ / /_/ / / / / /_/ / /_/ /
\____/\____/\__,_/_/ /_/\__/_/\__, /
              http://count.ly/____/
-->
<html>
<head>
	<link href='stylesheets/pre-login/main.css' rel='stylesheet' type='text/css'>
	<link rel="icon" type="image/png" href="images/favicon.png">
    <% if (themeFiles && themeFiles.css) { %>
        <% for(var i=0, l=themeFiles.css.length; i<l; i++) {%>
    <link href='<%= themeFiles.css[i]%>' rel='stylesheet' type='text/css'>
        <% } %>
    <% } %>
	<title><%- countlyTitle %></title>
	<script>window.countlyGlobal = window.countlyGlobal || {}; countlyGlobal["cdn"] = "<%- cdn %>";</script>
</head>
<body>
	 <% if (message){ %>
		<div id="message"></div>
	 <% } %>
	<div id="top-container">
		<% if (countlyPage){ %>
		<a class="top-button" href="<%- countlyPage %>"><%- countlyTitle %></a>
        <% } %>
		<div class="top-button" id="select-lang">
			<div id="active-lang">EN</div>
			<div id="langs">
				<div class="group">
					<a data-language-code="de" class="item">Deutsch</a>
					<a data-language-code="en" class="item">English</a>
					<a data-language-code="es" class="item">Español</a>
					<a data-language-code="fr" class="item">Français</a>
					<a data-language-code="it" class="item">Italiano</a>
                    <a data-language-code="nl" class="item">Nederlands</a>
					<a data-language-code="lv" class="item">Latviski</a>
                    <a data-language-code="hu" class="item">Magyar</a>
                    <a data-language-code="el" class="item">Ελληνικά</a>
				</div>
				<div class="group">
					<a data-language-code="et" class="item">Eesti</a>
                    <a data-language-code="pt" class="item">Português</a>
                    <a data-language-code="ru" class="item">Русский язык</a>
					<a data-language-code="tr" class="item">Türkçe</a>
					<a data-language-code="zh" class="item">中文</a>
					<a data-language-code="ja" class="item">日本語</a>
					<a data-language-code="ko" class="item">한국어</a>
                    <a data-language-code="vi" class="item">Tiếng Việt</a>
				</div>
			</div>
		</div>
	</div>
	<div id="login-form">
		<div style="overflow:auto;">
            <div id="login-logo" style="margin-bottom:30px;"></div>
            <form method="POST">
                <div>
                    <input type="text" autocapitalize="off" name="username" placeholder="Username or Email" data-localize="placeholder.username-email"/>
                </div>
                <div>
                    <input name="password" type="password" placeholder="Password" data-localize="placeholder.password"/>
                </div>
                <% if (typeof form != "undefined") { %>
                    <%- form %>
                <% } %>
                <div>
                    <input type="hidden" value="<%= csrf %>" name="_csrf" />
                    <input type="hidden" value="en" name="lang" id="form-lang" />
                    <input id="login-button" value="Login" type="submit" data-localize="login.button"/>
                </div>
                <div style="margin-top:30px;">
                    <a id="forgot-password" href="./forgot"  data-localize="login.forgot"></a>
                </div>
            </form>
		</div>
        <% if (typeof html != "undefined") { %>
            <%- html %>
        <% } %>
	</div>
	<script language="javascript" type="text/javascript" src="javascripts/dom/jquery/jquery-1.8.3.min.js"></script>
	<script language="javascript" type="text/javascript" src="javascripts/utils/prefixfree.min.js"></script>
	<script language="javascript" type="text/javascript" src="javascripts/dom/jquery.noisy.min.js"></script>
	<script language="javascript" type="text/javascript" src="javascripts/utils/store+json2.min.js"></script>
	<script language="javascript" type="text/javascript" src="javascripts/utils/jquery.i18n.properties-min-1.0.9.js"></script>
	<script language="javascript" type="text/javascript" src="javascripts/pre-login.js"></script>
	<script>
        var countlyTitle = "<%- countlyTitle %>";
		$(document).ready(function() {
			<% if (message){ %>
				showMessage("<%= message %>");
			<% } %>
			document.title = countlyTitle + " | " + jQuery.i18n.map["login.title"];
		});
		
		$(document).bind('clyLangChange', function() {
			document.title = countlyTitle + " | " + jQuery.i18n.map["login.title"];
		});
	</script>
	<% if (typeof javascript != 'undefined') { %>
	<script><%- javascript %></script>
	<% } %>
     <% if (themeFiles && themeFiles.js) { %>
        <% for(var i=0, l=themeFiles.js.length; i<l; i++) {%>
    <script language="javascript" type="text/javascript" src="<%=themeFiles.js[i]%>"></script>
        <% } %>
    <% } %>
</body>
</html>